package com.fqxiny.picture.model.enums;

import lombok.Getter;

@Getter
public enum PictureEditMessageTypeEnum {

    INFO("发送通知","INFO"),
    ERROR("发送错误","ERROR"),
    ENTER_EDIT("进入编辑状态","ENTER_EDIT"),
    EXIT_EDIT("退出编辑状态","EXIT_EDIT"),
    EDIT_ACTION("执行编辑操作","EDIT_ACTION");

    private final String test;
    private final String value;

    PictureEditMessageTypeEnum(String test, String value) {
        this.test = test;
        this.value = value;
    }

    public static PictureEditMessageTypeEnum getEnumByValue(String value){
        if(value == null || value.isEmpty()){
            return null;
        }

        for (PictureEditMessageTypeEnum pictureEditMessageTypeEnum : PictureEditMessageTypeEnum.values()) {
            if(pictureEditMessageTypeEnum.value.equals(value)){
                return pictureEditMessageTypeEnum;
            }
        }
        return null;
    }
}
